<%@page language="java" contentType="text/html; charset=UTF-8"%> 
<script type="text/javascript">
function add2Favorite(url,title){
	try {
			window.sidebar.addPanel(title, url, "");
		} catch (e) {
			try {
				window.external.AddFavorite(url, title);
			} catch (e1) {
				alert("您的浏览器不支持此项操作，请尝试快捷键 Ctrl + D 或 Cmd + D(Mac系统)");

			}
		}
	}
function updateUser(user){
	if(user){
		$("#top_welcome").html("<span>"+user.nickname+"</span> &nbsp;&nbsp;<a href='${ctx}/user/loginOut.action'>[退出]</a> ");
	}else{
		$("#top_welcome").html("欢迎来到本站！<a href='${ctx }/user/login.action'>[登录]</a>&nbsp;&nbsp;	<a href='${ctx}/user/regist.action'>[注册]</a>");
	}
}	
</script>
<div id="top"  >
	<div class="width center" >
		<div id="menubar">
			<ul class="left">
				<li><i class="i-favorite"></i><a href="javascript:add2Favorite('http://www.zcode.com.cn/exam/index.action','Z-CODE[考试系统]')">收藏本站</a></li>
			</ul>
			<ul class="right">
				<li id="top_welcome">
				 <shiro:notAuthenticated>
						 欢迎来到本站！<a href="${ctx }/user/login.action">[登录]</a>&nbsp;&nbsp;	<a href="${ctx}/user/regist.action">[注册]</a>
				</shiro:notAuthenticated>
				<shiro:authenticated>
				
						<span> ${user.nickname} </span> &nbsp;&nbsp;<a href="${ctx}/user/loginOut.action">[退出]</a> 
				</shiro:authenticated>
					 
				</li>
				
				<shiro:authenticated>
					<li><span class="sepator">|</span></li>
					<li><i class="i-backhome"></i><a href="${ctx}/exam/index.action">首页</a></li>
					<li><span class="sepator">|</span></li>
					<li><a href="${ctx}/exam/startExam.action">开始答题</a></li>
					<li><span class="sepator">|</span></li>
					<li><a href="${ctx}/exam/myWrongs.action">我的错题</a></li>
					<li><span class="sepator">|</span></li>
					
				
					<li><i class="i-userinfo"></i><a href="${ctx}/user/profile.action">个人中心</a></li>
				</shiro:authenticated>
				
				 <shiro:hasRole name="admin">
				 <li><span class="sepator">|</span></li>
				  <li><i class="i-backhome"></i><a href="${ctx}/manager/index.action">系统管理</a></li>
				 </shiro:hasRole>
				 
			</ul>
		</div>
	</div>
</div>
<div class="width center">
	<a href="${ctx}/exam/index.action"><div id="logo"></div></a>
</div>


